import { createRoot } from 'react-dom/client'
import App from '@/App'
import { BrowserRouter } from "react-router-dom"
import '@/common/style/index.less'
// 样式初始化 normalize.css
import 'normalize.css'
import { ConfigProvider } from 'antd';
import zhCN from 'antd/locale/zh_CN';
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';
// 注册 redux
import { store, persistor } from './store'
import { Provider } from 'react-redux'
import { PersistGate } from 'redux-persist/integration/react';
import { GlobalProvider } from './components/global'

// import Nprogress from 'nprogress'
// import 'nprogress/nprogress.css'
// // 启动进度条
// Nprogress.start()
// // 结束进度条
// Nprogress.done()
// Nprogress.configure({
//   easing: 'ease', // 动画方式
//   speed: 500, // 递增进度条的速度
//   showSpinner: false, // 是否显示加载icon,动画
//   trickleSpeed: 200, // 自动递增间隔
//   minimum: 0.3 // 初始化时的最小百分比
// })
// antd全局汉化
dayjs.locale('zh-cn');
createRoot(document.getElementById('root')!).render(
  <BrowserRouter>
    <GlobalProvider>
      <ConfigProvider locale={zhCN}>
        <Provider store={store}>
          <PersistGate loading={null} persistor={persistor}>
            <App />
          </PersistGate>
        </Provider>
      </ConfigProvider>
    </GlobalProvider>
  </BrowserRouter>
)
